<template>
    <div style="object-fit: fill;">
        <img :src="imgSrc" alt="职位词云">
    </div>
</template>

<script>
import { getSkillWordCloud } from '@/api/base.js';


export default {
    data() {
        return {
            image: ''
        }
    },
    created() {
        this.fetchImage()
    },
    methods: {
        async fetchImage() {
            // 渲染后端计算出来的词云图片

            getSkillWordCloud().then(res => {
                console.log(res)
                this.image = res.data
            })
        }
    },
    computed: {
        imgSrc() {
            return `data:image/jpeg;base64,${this.image}`
        }
    }
}
</script>

<style scoped>
img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}
</style>
